import os
def tflite_to_c_array(input_file, output_file):
    with open(input_file, 'rb') as f:
        content = f.read()

    with open(output_file, 'w') as f:
        f.write("unsigned char sine_model_quantized_tflite[] = {\n")
        for byte in content:
            f.write(f"0x{byte:02x}, ")
        f.write("\n};\n")
        f.write(f"unsigned int sine_model_quantized_tflite_len = {len(content)};\n")


input_file = 'sine_model_quantized_generated.tflite'
output_file = 'sine_model_quantized_generated.cc'
tflite_to_c_array(input_file, output_file)

# Print the generated C source file
with open(output_file, 'r') as f:
    print(f.read())

